-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude (not set) city and country from reports. #9943
Exclude (not set) city and country from reports. #9943
Conversation
Build files for cf5d2f9 have been deleted. |
Size Change: -4 B (0%) Total Size: 1.98 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ankitrox, this needs a revision, please see my comments.
assets/js/modules/analytics-4/components/widgets/TopCitiesWidget.js
Outdated
Show resolved
Hide resolved
assets/js/modules/analytics-4/components/widgets/TopCountriesWidget.js
Outdated
Show resolved
Hide resolved
aa8171d
to
a4cdb3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ankitrox, that's working nicely. There's one more update needed, please see my comment.
assets/js/modules/analytics-4/components/widgets/TopCitiesWidget.js
Outdated
Show resolved
Hide resolved
Thank you @techanvil . I have created a separated utility function so that we can use it in both places. Also added tests for the function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ankitrox! A couple of last tweaks and this should be good to go.
@@ -0,0 +1,25 @@ | |||
/** | |||
* Analytics 4 filter rows having (not set) values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's tweak the description to be a bit clearer:
* Analytics 4 filter rows having (not set) values. | |
* Utility to filter out Analytics report rows which don't have a value set. |
* Analytics-4 filter rows having (not set) values tests. | ||
* | ||
* Site Kit by Google, Copyright 2022 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, and also fix the date:
* Analytics-4 filter rows having (not set) values tests. | |
* | |
* Site Kit by Google, Copyright 2022 Google LLC | |
* Tests for utility to filter out Analytics report rows which don't have a value set. | |
* | |
* Site Kit by Google, Copyright 2024 Google LLC |
const mockRows = [ | ||
{ dimensionValues: [ { value: 'value1' } ] }, | ||
{ dimensionValues: [ { value: '(not set)' } ] }, | ||
{ dimensionValues: [ { value: 'value2' } ] }, | ||
{ dimensionValues: [ { value: 'value3' } ] }, | ||
{ dimensionValues: [ { value: 'value4' } ] }, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define this in a beforeEach()
to make the tests more robust. As things stand, if we consider reportRowsWithSetValues()
as a black box, it could in theory mutate this data structure between tests.
const mockRows = [ | |
{ dimensionValues: [ { value: 'value1' } ] }, | |
{ dimensionValues: [ { value: '(not set)' } ] }, | |
{ dimensionValues: [ { value: 'value2' } ] }, | |
{ dimensionValues: [ { value: 'value3' } ] }, | |
{ dimensionValues: [ { value: 'value4' } ] }, | |
]; | |
let mockRows; | |
beforeEach( () => { | |
mockRows = [ | |
{ dimensionValues: [ { value: 'value1' } ] }, | |
{ dimensionValues: [ { value: '(not set)' } ] }, | |
{ dimensionValues: [ { value: 'value2' } ] }, | |
{ dimensionValues: [ { value: 'value3' } ] }, | |
{ dimensionValues: [ { value: 'value4' } ] }, | |
]; | |
} ); |
Thanks for reviewing the PR @techanvil . I've updated the PR as per your suggestions and assigning it to you for reviewing the changes. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice one @ankitrox!
I've confirmed the failing tests are unrelated to the changes in this PR.
✅
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist